//
//  UIButton+Helper.m
//  DanaKreditLoan
//
//  Created by ZhengChengFeng on 2024/10/18.
//

#import "UIButton+Helper.h"

@implementation UIButton (Helper)

- (void)setImgUpTitltDown:(CGFloat)floatValue{
    CGFloat offset = floatValue;
    self.titleEdgeInsets = UIEdgeInsetsMake(0, -self.imageView.frame.size.width, -self.imageView.frame.size.height-offset, 0);
    self.imageEdgeInsets = UIEdgeInsetsMake(-self.titleLabel.intrinsicContentSize.height-offset, 0, 0, -self.titleLabel.intrinsicContentSize.width);
}

- (void)setImgRightTitltLeft:(CGFloat)floatValue{
    [self setTitleEdgeInsets:UIEdgeInsetsMake(0, -self.imageView.bounds.size.width + floatValue, 0, self.imageView.bounds.size.width + floatValue)];
    [self setImageEdgeInsets:UIEdgeInsetsMake(0, self.titleLabel.bounds.size.width, 0, -self.titleLabel.bounds.size.width)];
}


@end
